<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var now = new Date();
//    获取年份

    var year = now.getFullYear(); // 2015

//    获取月份
    var month = now.getMonth(); // 11 + 1 (从0开始)

//    获取日期
    var day = now.getDate(); // 10

//    获取星期几
    var weekday = now.getDay(); // 4

//    获取时
    var hour = now.getHours(); // 19

//    获取分
    var minute = now.getMinutes(); // 1

//    获取秒
    var second = now.getSeconds(); // 24

//    获取毫秒
    var milliSecond  = now.getMilliseconds(); // 93

//    获取日期的timestamp值
    var timestamp_a = now.valueOf(); //1449748915093
    var timestamp_b = now.getTime(); //1449748915093

</script>
</body>
</html>